export default {
    // host 地址
    // host: 'http://localhost:8080/',
    host: 'http://www.mumulucky.com/',
	app: {
        configParameters: {
            rotate: 90,
            align: 'left',
            verticalAlign: 'middle',
            position: 'insideBottom',
            distance: 15,
            onChange: function () {
                var labelOption = {
                    normal: {
                        rotate: app.config.rotate,
                        align: app.config.align,
                        verticalAlign: app.config.verticalAlign,
                        position: app.config.position,
                        distance: app.config.distance
                    }
                };
                myChart.setOption({
                    series: [{
                        label: labelOption
                    }, {
                        label: labelOption
                    }, {
                        label: labelOption
                    }, {
                        label: labelOption
                    }]
                });
            }   
        },
        config: {

            rotate: 90,
            align: 'left',
            verticalAlign: 'middle',
            position: 'insideBottom',
            distance: 15,
            onChange: function () {
                var labelOption = {
                    normal: {
                        rotate: app.config.rotate,
                        align: app.config.align,
                        verticalAlign: app.config.verticalAlign,
                        position: app.config.position,
                        distance: app.config.distance
                    }
                };
                myChart.setOption({
                    series: [{
                        label: labelOption
                    }, {
                        label: labelOption
                    }, {
                        label: labelOption
                    }, {
                        label: labelOption
                    }]
                });
            }
        }
    },
    /*
        填充项 
        option.xAxis[0].data
        option.series[0].name = data.body.above_limit.name
        option.series[0].type = 'bar'
        option.series[0].data = data.body.above_limit.value
        option.series[1].name = data.body.total_amount.name
        option.series[1].type = 'bar'
        option.series[1].data = data.body.total_amount.value
        option.series[2].name = data.body.rate.name
        option.series[2].type = 'line'
        option.series[2].data.push(element * 100)
    */
    option: {
        color: ['#BFEBFF', '#2185C5', '#FF8497'],
        grid: {
            left: '8%',
            right: '8%',
            show: false,
            // borderColor: '#000000'
        },
        title: {
            // text: '会员复购率分析',
            // subtext: ''
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                // 默认为直线，可选为：'line' | 'shadow' | 'cross'
                type: 'cross',
                // label: {
                //     backgroundColor: '#283b56'
                // }
            }
        },
        legend: {
            show: false
            // dasta:['订单总数', '2单及以上订单数', '复购率']
        },
        toolbox: {
            show: false,
            feature: {
                dataView: {readOnly: false},
                restore: {},
                saveAsImage: {}
            }
        },
        dataZoom: {
            show: false,
            start: 0,
            end: 100
        },
        xAxis: [
            {
                type: 'category',
                // boundaryGap : true,
                data: [],
                axisLine: {
                    symbol: 'none',
                    lineStyle: {
                        color: "#748292",
                        width: 2
                    }
                },
                // 去除坐标刻度
                axisTick: {
                    show: false
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                scale: true,
                // name: '数量',
                // max: 3000,
                min: 0,
                boundaryGap: [0.2, 0.2],
                axisLine: {
                    symbol: 'none',
                    lineStyle: {
                        color: "#748292",
                        width: 2
                    }
                },
                // 去除坐标刻度
                axisTick: {
                    show: false
                }
            },
            {
                type: 'value',
                scale: true,
                // name: '百分比',
                max: 100,
                min: 0,
                boundaryGap: [0.2, 0.2],
                axisLabel: {
                    formatter: '{value} %'
                },
                axisLine: {
                    lineStyle: {
                        color: "#748292",
                        width: 2
                    }
                },
                splitLine: {
                    lineStyle: {
                        color: "#D7E0E6"
                    }
                },
                // 去除坐标刻度
                axisTick: {
                    show: false
                }
            }
        ],
        series: [
            {
                name:'',
                type:'',
                // yAxisIndex: 0,
                // stack: '总量',
                barWidth: '50%',
                label: {
                    normal: {
                        show: false,
                        position: 'top'
                    }
                },
                areaStyle: {normal: {}},
                data:[]
            },
            {
                name:'2单及以上订单数',
                type:'bar',
                // yAxisIndex: 0,
                // stack: '总量',
                barWidth: '50%',
                barGap: '-100%',
                label: {
                    normal: {
                        show: false,
                        position: 'top',
                        formatter: '%'
                    }
                },
                areaStyle: {normal: {}},
                data:[]

            },
            {
                name:'复购率',
                yAxisIndex: 1,
                type:'line',
                symbol: 'emptyCircle',
                symbolSize: 6,
                data:[],
                label: {
                    normal: {
                        show: false,
                        formatter: '{c}%',
                        // fontSize: 16,
                        rich: {
                            name: {
                                // textBorderColor: '#fff'
                            }
                        }
                    }
                },
                itemStyle: {
                    borderWidth: 2,
                },
                lineStyle: {
                    width: 1
                }
            }
        ]
    }
}
